class AddPictureTable < ActiveRecord::Migration
  def self.up
#    create_table :pictures do |t|
#      t.column :comment, :string, :null => false
##       A string to be used as MIME/TYPE for the http request
##       TODO: write a method to extrac this for the extension in the model
#      t.column :content_type, :string, :null =>false
##       Warning bytea is NOT database agnostic, maybe it wont wokrs
##       even on different POSTGRES verision here Im using verison
##       7.4.12
##       TODO: How to add conditional code here that generates the proper
##       datatype for a given database
#      t.column :data, :bytea, :null => false
#      t.column :name, :string, :null=> false
#    end
    create_table "pictures", :force => true do |t|
      t.column "comment", :string, :null => false
      t.column "content_type", :string, :null => false
      t.column "data", :binary, :null => false
      t.column "name", :string, :null => false
    end            
  end

  def self.down
    drop_table :pictures
  end
end
